import 'package:flutter/material.dart';
import 'package:honeypotflutter/publicBussine/bussine_colors.dart';
import 'package:honeypotflutter/publicBussine/bussine_font.dart';
import 'package:honeypotflutter/publicBussine/bussine_image.dart';
import 'package:honeypotflutter/publicBussine/view/bussine_card.dart';
import '../model/cabinet_list_model.dart';
import 'cabinet_list_header.dart';

class CabinetListItem extends StatelessWidget {
  final CabinetListModel itemModel;
  final Function()? itemAction;
  const CabinetListItem({
    super.key,
    required this.itemModel,
    this.itemAction,
  });

  @override
  Widget build(BuildContext context) {
    return MGCard(
      margin: EdgeInsets.only(left: 16, right: 16, top: 12),
      children: [
        SizedBox(height: 10),
        CabinetListHeader(
          deviceID: itemModel.disPlayNo ?? "",
          deviceName: itemModel.deviceAddress ?? "",
        ),
        Container(
          margin: EdgeInsets.only(top: 20, bottom: 18),
          child: Row(
            children: [
              Text(
                "锁柜",
                style: TextStyle(
                  color: MGColors.text3Color,
                  fontSize: MGFont.textFont3,
                ),
              ),
              Image.asset(MGImage.image("public_next"), width: 14),
            ],
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
          ),
        )
      ],
      action: itemAction,
    );
  }
}
